home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / Lines Curves and Area Fills / BoxingTheClient / BoxingTheClient.cs next >
Encoding:
Text File  |  2001-01-15  |  845 b   |  29 lines

  1. //----------------------------------------------
  2. // BoxingTheClient.cs ⌐ 2001 by Charles Petzold
  3. //----------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class BoxingTheClient: PrintableForm
  9. {
  10.      public new static void Main()
  11.      {
  12.           Application.Run(new BoxingTheClient());
  13.      }
  14.      public BoxingTheClient()
  15.      {
  16.           Text = "Boxing the Client";
  17.      }
  18.      protected override void DoPage(Graphics grfx, Color clr, int cx, int cy)
  19.      {
  20.           Point[] apt = {new Point(0,      0),
  21.                          new Point(cx - 1, 0),
  22.                          new Point(cx - 1, cy - 1),
  23.                          new Point(0,      cy - 1),
  24.                          new Point(0,      0)};
  25.  
  26.           grfx.DrawLines(new Pen(clr), apt);
  27.      }
  28. }
  29.